import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/login",
  },
  {
    path: "/login",
    component: () => import("../views/Login.vue"),
  },
  {
    path: "/home",
    component: () => import("../views/Home.vue"),
    children: [
      {
        path: "/bizVerify",
        component: () => import("../components/shops/BizVerify.vue"),
      },
      {
        path: "/bizList",
        component: () => import("../components/shops/BizList.vue"),
      },
      {
        path: "/repairDepot",
        component: () => import("../components/shops/RepairDepot.vue"),
      },
      {
        path: "/driverOrder",
        component: () => import("../components/order/DirverOrder.vue"),
      },
      {
        path: "/inputOrder",
        component: () => import("../components/order/inputOrder.vue"),
      },
      {
        path: "/orderList",
        component: () => import("../components/order/orderList.vue"),
      },
      {
        path: "/staffList",
        component: () => import("../components/business/StaffList.vue"),
      },
      {
        path: "/driverList",
        component: () => import("../components/driver/BriverList.vue"),
      },
      {
        path: "/billList",
        component: () => import("../components/bill/BillList.vue"),
      },
      {
        path: "/stationList",
        component: () => import("../components/station/StationList.vue"),
      },
    ],
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
